package com.cjj.common.entity;

import com.alibaba.excel.metadata.BaseRowModel;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @author DoyuTu
 */
@Data
@AllArgsConstructor
public class ExportExcelData {

    /**
     * Sheet名称
     */
    private String sheetName;

    private Map<Integer, Integer> columnWidthMap;

    private List<? extends BaseRowModel> dataList;

    /**
     * dataList的补充属性
     * 当dataList可为空时能正常导出
     */
    private Class<? extends BaseRowModel> clazz;

    public ExportExcelData(String sheetName, List<? extends BaseRowModel> dataList) {
        this.sheetName = sheetName;
        this.dataList = dataList;
    }

    public ExportExcelData(String sheetName, Map<Integer, Integer> columnWidthMap, List<? extends BaseRowModel> dataList) {
        this.sheetName = sheetName;
        this.columnWidthMap = columnWidthMap;
        this.dataList = dataList;
    }

    public ExportExcelData(String sheetName, List<? extends BaseRowModel> dataList, Class<? extends BaseRowModel> clazz) {
        this.sheetName = sheetName;
        this.dataList = dataList;
        this.clazz = clazz;
    }

}
